package com.vjwealth.android.nos.utils

/**
 * projectName KNOS
 * date 2017/9/28
 * description com.vjwealth.android.nos.utils
 */
class RegexPatternUtils {

    companion object {
        private val URL = "[a-zA-z]+://[^\\s]*"
        private val EMAIL = "\\w+@(\\w+.)+[a-z]{2,3}"
        private val LOGINNAME = "^[a-zA-Z0-9_]{3,20}$"
        private val PASSWORD = "^[a-zA-Z0-9_]{6,31}$"
        private val CHARS = "[`~!@#$%^&*()+ =|{}':;',\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？]"
        private val TEL = "\\d{3}-\\d{8}|\\d{4}-\\d{8}|\\d{4}-\\d{7}|\\d{3}-\\d{7}|\\d{3}\\d{8}|\\d{4}\\d{8}|\\d{3}\\d{7}|\\d{4}\\d{7}"
        private val ZIP_CODE = "[1-9]\\d{5}(?!\\d)"
        private val ID_CARD_NO15 ="^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$"
        private val ID_CARD_NO18 ="^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{4}$"
        private val PHONE = "^((13[0-9])|(15[0,0-9])|(18[0,0-9])|(17[0,0-9])|(14[0,0-9]))\\d{8}$"
        private val NUMBER="^[0-9]+$"
        private val AMOUNT="^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$" //判断金额
        private val BANK_CARD_VJ = "^[0-9]{16,19}$"
        private val ID_CARD_VJ = "^(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)$"
        private val PASSID_CARD_NO = "^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$"
        private val PASSID_CARD_NO1 = "^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)$"
        private val IS_CAR_NUMBER = "^[京,津,冀,晋,蒙,辽,吉,黑,沪,苏,浙,皖,闽,赣,鲁,豫,鄂,湘,粤,桂,琼,渝,川,贵,云,藏,陕,甘,青,宁,新]{1}[A-Z]{1}[A-Z_0-9]{5,6}$"

        fun isCarNumber(carNum: String): Boolean{
            return carNum.matches(IS_CAR_NUMBER.toRegex())
        }

        fun isPhone(phone: String): Boolean {
            return phone.matches(PHONE.toRegex())
        }
    }
}